package com.dushibao.util;

import com.dushibao.entity.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * ThreadLocal 当前线程变量的一个副本
 * CurrentThread
 */
public class SecurityHolder {
    public static ThreadLocal<HttpServletRequest> request = new ThreadLocal<HttpServletRequest>();
    public static ThreadLocal<HttpServletResponse> response = new ThreadLocal<HttpServletResponse>();

    public static void setContext(HttpServletRequest request,HttpServletResponse response){
        SecurityHolder.request.set(request);
        SecurityHolder.response.set(response);
    }
}
